package com.yan.demo;

import java.math.BigInteger;

public class Demo6 {
    public static void main(String[] args) {
        // 大数字运算 10000000000000000000000000000000000000000000000000000000000000000000000000000
        BigInteger big1 = new BigInteger("10000000000000000000000000000000000000000000000000000000000000000000000000000");
        BigInteger big2 = new BigInteger("2");
        BigInteger add = big1.add(big2);
        System.out.println("add = " + add);
        BigInteger subtract = big1.subtract(big2);
        System.out.println("subtract = " + subtract);
        BigInteger multiply = big1.multiply(big1);
        System.out.println("multiply = " + multiply);
        BigInteger divide = big1.divide(big2);
        System.out.println("divide = " + divide);
        BigInteger remainder = big1.remainder(big2);
        System.out.println("remainder = " + remainder);
        BigInteger[] bigIntegers = big1.divideAndRemainder(big2);
        System.out.println("bigIntegers = " + bigIntegers[0]);
        System.out.println("bigIntegers = " + bigIntegers[1]);


    }
}
